import { createBrowserRouter } from 'react-router-dom'
import { lazy } from 'react'

import Error from '../pages/404/Index'
import Login from '../pages/login/Index'
import Layout from '../pages/layout/Index'
export let Home = lazy(() => import('../pages/home/Index'))

export let childroute = [
    {
        path: '/',
        element: <Home></Home>,
        name: '首页'
    }
]
let routes = createBrowserRouter([
    {
        path: '/',
        element: <Layout></Layout>,
        children: childroute
    },
    {
        path: '/login',
        element: <Login></Login>,

    },
    {
        path: '*',
        element: <Error></Error>,

    },

])

export default routes